﻿#region Header
// ------------------------ Licence / Copyright ------------------------
// 
// ScrumTable for Scrum Meeting Support
// Copyright © HSR - Hochschule für Technik Rapperswil
// All Rights Reserved
// 
// Author:
//  Michael Gfeller Silvan Gehrig Patrick Boos
// 
// ---------------------------------------------------------------------
#endregion

#region Usings

#endregion

using System;

namespace ScrumTable.DL.Data.TFS.Services.SharePoint
{
    /// <summary>
    /// This class is used to wrap an iteration entry in the UserList.
    /// </summary>
    public class WssUser
    {
        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------

        #endregion

        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------

        /// <summary>
        /// Gets the user id (Domain Name).
        /// </summary>
        public string Id { get; private set; }

        /// <summary>
        /// Gets the picture URI of the user.
        /// </summary>
        public Uri PictureUrl { get; private set; }

        #endregion

        #region Constructors / Destructor
        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------

        /// <summary>
        /// Creates a new WssUser instance. This constructor is used in
        /// the current library only.
        /// </summary>
        internal WssUser(string id, string pictureUrl)
        {
            Id = id;

            if (!string.IsNullOrEmpty(pictureUrl))
            {
                Uri toSet;

                if (Uri.TryCreate(pictureUrl, UriKind.RelativeOrAbsolute, out toSet))
                {
                    PictureUrl = toSet;
                }
            }
        }

        #endregion

        #region Methods
        //--------------------------------------------------------------------
        // Methods
        //--------------------------------------------------------------------

        #endregion

        #region Events
        //--------------------------------------------------------------------
        // Events
        //--------------------------------------------------------------------

        #endregion
    }
}
